﻿#include "fileButton.hpp"
using namespace ribbonStyleControls::Controls;
FileButton::FileButton(QString name, QString iconPath, QWidget* parent)
	:ToolButtonIconTextEntirety(name, iconPath, parent)
{
	m_filewindoitem = new fileWinodwItem();
	appendAction(new templateItemWidget(m_filewindoitem));//将制作的菜单添加到menu中
}

QSize FileButton::sizeHint() const
{
	return QSize(60, 32);
}

QColor FileButton::staticBackground()
{
	return QColor(255,255,255);
}

bool FileButton::upClickOpenMenu()
{
	return true;
}

bool FileButton::downClickOpenMenu()
{
	return true;
}

QPoint FileButton::showMenuPos()
{
	//设置为菜单按钮的下方显示
	QPoint buttonPos = this->mapToGlobal(QPoint(0, this->height()));//转换为全局坐标系
	return buttonPos;
}
